#include "dominion.h"
#include "dominion_helpers.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int cardEffect(int card, int choice1, int choice2, int choice3, struct gameState *state, int handPos, int *bonus);

void test()
{
	struct gameState g;
	struct gameState * game = &g;
	memset(game, 0, sizeof(struct gameState));
	int currentPlayer;
	int handCount;
	int coins;
		
	int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, 
		sea_hag, tribute, smithy};
	initializeGame(4, k, 2, game);
	int coin_bonus = 0;
	
	currentPlayer = whoseTurn(game);	
	handCount = game->handCount[currentPlayer];
	cardEffect(steward, 1, -1, -1, game, 0, &coin_bonus);
	
	if (game->handCount[currentPlayer] == handCount + 1)
		printf("stewardcardplay(): PASS when test drawing 2 cards\n");
	else
		printf("stewardcardplay(): FAIL when test drawing 2 cards\n");

	currentPlayer = whoseTurn(game);
	coins = game->coins;
	cardEffect(steward, 2, -1, -1, game, 0, &coin_bonus);
	
	if (game->coins == coins + 2)
		printf("stewardcardplay(): PASS when test adding 2 coins\n");
	else
		printf("stewardcardplay(): FAIL when test adding 2 coins\n");

	currentPlayer = whoseTurn(game);
	handCount = game->handCount[currentPlayer];
	cardEffect(steward, 3, 1, 2, game, 0, &coin_bonus);
	
	if (game->handCount[currentPlayer] == handCount - 3)
		printf("stewardcardplay(): PASS when test trashing 2 cards\n");
	else
		printf("stewardcardplay(): FAIL when test trashing 2 cards\n");
}

int main(int argc, char *argv[])
{
	test();
	return 0;
}
